﻿#This creates the definition for the resource

$scriptPath = $PSCommandPath
$scriptfile = Get-Item -Path $scriptPath

$schemaMofFile = $scriptfile.Directory.Parent.FullName

write-host "Start generating $schemaMofFile" -ForegroundColor Green

#The share to create
$Url = New-xDscResourceProperty -Name Url -Type String -Attribute Required

#The path where the folder that maps to the share should be created
$Path      = New-xDscResourceProperty -Name Path -Type String -Attribute Key

#The Svn User Name
$UserName      = New-xDscResourceProperty -Name UserName -Type String -Attribute Write

#The Svn Password
$Password      = New-xDscResourceProperty -Name Password -Type String -Attribute Write

#The Svn Revision
$Revision      = New-xDscResourceProperty -Name Revision -Type Uint32 -Attribute Write

#Identify if the action is to create the share or remove the share (i.e. should it be present or absent)
$Ensure    = New-xDscResourceProperty -Name Ensure -Type String -Attribute Write -ValidateSet "Present", "Absent"

#Create the actual resource
New-xDscResource -Name MESF_cSubversionSynchronization -Property $Url, $Path, $Ensure, $UserName, $Password, $Revision -Path $schemaMofFile -FriendlyName cSubversionSynchronization

write-host "End generating $schemaMofFile" -ForegroundColor Green
